package com.aaa.javaweb.servlet;

import com.aaa.javaweb.dao.ZhuCeDao;
import com.aaa.javaweb.entity.Zhuce;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.util.List;
import java.util.Map;

@Controller

public class ZhuCeController {
    @Autowired
    private ZhuCeDao zhuCeDao;

    @RequestMapping("zhuce")
    @ResponseBody
    public int zhuce(Zhuce zhuce) {
        List<Map> maps = zhuCeDao.selectzc(zhuce);
        if (maps.size() == 0) {
            int i = zhuCeDao.insertadd(zhuce);
            return 1;
        } else {

            return 0;
        }

    }

}
